package app.android.alampang.model;

import org.json.JSONObject;

/**
 * Created by Supanut on 2/13/2015.
 */
public class Note extends BaseModel {

    private int id;
    private String name;
    private String description;
    private String imageUri;

    public Note()
    {
        PARSING_NAME = "NOTE";
    }


    public void setImageUri(String imageUri) {
        this.imageUri = imageUri;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    public String getImageUri() {
        return imageUri;
    }



    @Override
    public JSONObject toJSONObject() {
        JSONObject json = new JSONObject();
        try {


            json.put("id", id);
            json.put("name", name);
            json.put("description", description);
            json.put("imageUri", imageUri);

        }
        catch (Exception e){}
        return json;
    }

    @Override
    public void parseFromJSONString(String jsonString) {
        try
        {
            JSONObject json = new JSONObject(jsonString);
            id = json.getInt("id");
            description = json.getString("description");
            name = json.getString("name");
            imageUri = json.getString("imageUri");

        }
        catch (Exception e)
        {

        }
    }
}
